package day01;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;

/**
 * @author feng
 * @Date 2021/10/17 8:31
 *   只能存放引用数据类型
 *   自动装箱
 *   接口实现类，实现接口及父接口的全部方法
 *
 */
public class ListTest {
    public static void main(String[] args) {
        List mylist = new ArrayList();
        mylist.add(10);
        mylist.add("abc");
        mylist.add(20);
        System.out.println(mylist);
        // 集合的插入
        mylist.add(1,50);
        System.out.println(mylist);
        //集合的修改
        mylist.set(1,100);
        System.out.println(mylist);
        /*//清除
        mylist.clear();
        System.out.println(mylist);*/

        //遍历
        for (int i = 0; i <mylist.size() ; i++) {
            System.out.println(mylist.get(i));
        }

        Vector v = new Vector();
               v.add("asa");
        LinkedList linkedList = new LinkedList();
    }

}
